Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
… the tab Playwright never hears when a page dialog closes without it. Electron cancels a beforeunload itself, and a person can answer a dialog in the desktop view. The server then kept the dialog pending: every queued agent call failed with dialogPending, and preview_dialog failed with "No dialog is showing". Clear the pending dialog when the tab's CDP session reports Page.javascriptDialogClosed, and enable the Page domain on that session for desktop-rendered tabs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d8d1657 to
a800fd6
Compare
|
Note 🤖 Claude Opus 5.5 responding on behalf of Byntham Closing as superseded by #19456. That PR made desktop tabs call |
Problem
When an agent in the desktop app navigates away from a page with a
beforeunloadhandler, the browser tab becomes unusable.preview_statuskeeps reporting abeforeunloaddialog. Every later preview call fails with "A browser dialog is pending", andpreview_dialogfails with "No dialog is showing" (later "already handled"). The tab stays stuck until it is closed. Forms that warn about unsaved changes do this, so an agent testing one hits it on every navigation.Change
Electron answers a
beforeunloaditself and cancels the unload. Chromium still sendsPage.javascriptDialogOpeningover CDP, thenPage.javascriptDialogClosed. Playwright listens only for the first event, so the server kept the dialog as pending. A person answering an alert in the desktop view causes the same problem.The tab's CDP session now clears the pending dialog on
Page.javascriptDialogClosed. Desktop-rendered tabs now enable the Page domain on that session; server tabs already did.Scope and approval
There is no prior issue. This is a small fix for an obvious bug: 10 added lines in
ServerBrowser.tsand one test. Contracts and clients are unchanged, and the only behavior change is that the server stops reporting a dialog that is already closed.Verification
ServerBrowser.test.tsemits a dialog on a desktop-rendered tab, then the CDP close. It checks thatpreview_statusreports no dialog and the next call runs. It fails without the fix. All 23 tests in the file pass. Server typecheck, lint, and format pass on the changed files.beforeunloadafter an edit. The same agent prompt ran on main and on this branch:The page still cancels the navigation on both builds (
ERR_ABORTED), as it should. Only the stale dialog state changes.Not checked: an alert or confirm answered by a person in the desktop view, and the desktop app on Windows and Linux.
Reviewed in two rounds by GPT-6.1 Sol, with no findings.
Fixed with Claude Opus 5.5 in Claude Code, working in T3 Code.
🤖 Generated with Claude Code
Note
Implemented by
claude-opus-5-5with the help ofgpt-6.1-sol